<template v-cloak>
    <Modal v-model="formsModel.velocity" title="分类管理" :loading="formsModel.submitLoading" @on-ok="formsSubmitClickEvent" @on-cancel="formsCancelClickEvent" :styles="{top: '12px'}" >
        <i-form ref="formsModel.forms" :model="formsModel.forms" :rules="formsModel.rules" label-position="top"
                style="margin: 12px 20px;padding: 12px 20px">
            <form-item label="分类名称" prop="name" required>
                <i-input v-model="formsModel.forms.name" placeholder="请输入活动名称" clearable></i-input>
            </form-item>
            <form-item label="分类图标" prop="image" required>
                <div class="demo-upload-list" v-if="formsModel.forms.image">
                    <image :src="formsModel.forms.image" fit="cover" width="100%" height="100%" ></image>
                    <div class="demo-upload-list-cover">
                        <icon type="ios-trash-outline" @click="imageRemoveClickEvent('image')"></icon>
                    </div>
                </div>
                {include file='marketing/_common/upload' success="imageUploadSuccessEvent" model="image" /}
            </form-item>

            <form-item label="分类排序" prop="weigh">
                <input-number :min="1" v-model.number="formsModel.forms.weigh" placeholder="请输入排序" style="width: 130px"></input-number>
                <span class="_forms-tips"><icon type="md-alert"></icon> 数字越大越靠前</span>
            </form-item>
            <form-item label="分类状态" prop="status">
                <i-switch size="large" v-model="formsModel.forms.status" true-value="normal" false-value="hidden">
                    <span slot="open">启用</span>
                    <span slot="close">禁用</span>
                </i-switch>
            </form-item>
        </i-form>
    </Modal>
</template>
